package cn.humaohua.study.yanmo_design_pattern.ch13.v1;

public class Box {
    // 开机命令
    private Command openCommand;

    private Command resetCommand;

    public void setOpenCommand(Command openCommand) {
        this.openCommand = openCommand;
    }

    public void setResetCommand(Command resetCommand) {
        this.resetCommand = resetCommand;
    }

    /**
     * 按下开机按钮
     */
    public void openButtonPressed() {
        this.openCommand.execute();
    }

    public void resetButtonPressed() {
        this.resetCommand.execute();
    }
}
